]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionDownloader: Remove pending updates with extension
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 9 Mar 2020 15:49:34 +0000 (16:49 +0100)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 17 Mar 2020 14:19:20 +0000 (14:19 +0000)
When an extension is uninstalled, there is no point in keeping
a pending update: If the update didn't fail (which it currently
does), we would end up sneakily reinstalling the extension.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2343

js/ui/extensionDownloader.js

index be7426be098214d4d4a9c1e199919ea6b521d1a4..b399394b1be85ea26cda1db4ce7348583eba2173 100644 (file)
@@ -56,6 +56,15 @@ function uninstallExtension(uuid) {
         return false;
 
     FileUtils.recursivelyDeleteDir(extension.dir, true);
+
+    try {
+        const updatesDir = Gio.File.new_for_path(GLib.build_filenamev(
+            [global.userdatadir, 'extension-updates', extension.uuid]));
+        FileUtils.recursivelyDeleteDir(updatesDir, true);
+    } catch (e) {
+        // not an error
+    }
+
     return true;
 }